<template>
  <div class="app-container">
    <el-form :inline="true" label-width='90px'>
      <el-form-item label="粉丝名称：">
        <el-input v-model="queryParam.nickname" placeholder="请输入粉丝名称" clearable />
      </el-form-item>
      <el-form-item>
        <el-button class="filter-item search" type='primary' icon="el-icon-search" @click="handleSearch">查询</el-button>
        <el-button class="filter-item" icon="el-icon-refresh" @click="handleRefresh">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="data"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      default-expand-all
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    >
      <el-table-column label="粉丝头像" align='center'>
        <template slot-scope="info">
          <img :src="info.row.avatar" alt="" class="avatar">
        </template>
      </el-table-column>
      <el-table-column prop="nickname" label="粉丝名称" align='center'/>
      <el-table-column label="地址" align='center'>
        <template slot-scope="item">
          {{item.row.country}}{{item.row.province}}{{item.row.city}}
        </template>
      </el-table-column>
      <el-table-column label="关注状态" align='center'>
        <template slot-scope="item">
          {{item.row.status==1?'关注':'未关注'}}
        </template>
      </el-table-column>
      <el-table-column prop="created_at" label="关注时间"  align='center'/>
      <el-table-column prop="remark" label="备注" align='center'/>
    </el-table>
    <el-pagination
      background
      class="pagination-container"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="paginate.current"
      :hide-on-single-page='isHideSingle'
      :page-sizes="paginate.sizes"
      :page-size="paginate.limit"
      :layout="paginate.layout"
      :total="paginate.total"/>
  </div>
</template>

<script>
import formOperate from '@/layout/mixin/formOperate'
export default {
  name: 'Index',
  mixins: [formOperate],
  data() {
    return {
      url:'/wechat/official/users',
      queryParam: {
        nickname: '',
        limit:'',
        page:1,
        page_size:10
      },
      defaultQueryParam:['page','page_size'],
    }
  },
  methods: {
  }
}
</script>
<style>
  .details .el-dialog__body{
    height: 700px;
    overflow-y: auto;
  }
  .avatar{
    width: 50px;
  }
</style>